<?php

namespace App\Model;

use Zizaco\Entrust\EntrustRole;

/**
 * App\Model\Role
 *
 * @property integer $id
 * @property string $name
 * @property string $display_name
 * @property string $description
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Model\Admin[] $users
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Model\Permission[] $perms
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereDisplayName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereDescription($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Model\Role whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class Role extends EntrustRole
{
    protected $guarded = [];

    public function users()
    {
        return $this->belongsToMany('App\Model\Admin', 'role_user');
    }
}
